#[cfg(test)]
mod tests {
    use regex::Regex;

    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);

        let re = Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
        assert!(re.is_match("2014-01-01"));

        static TO_SEARCH: &str = "On 2017-12-31, happy. On 2018-01-01, New Year";
        let re = Regex::new(r"(\d{4})-(\d{2})-(\d{2})").unwrap();
        for caps in re.captures_iter(TO_SEARCH) {
            println!(
                "year {} month {} day {}",
                caps.get(1).unwrap().as_str(),
                caps.get(2).unwrap().as_str(),
                caps.get(3).unwrap().as_str()
            );
        }
        assert!(re.is_match(TO_SEARCH));
    }
}
